package com.heima.wemedia.threadLocal;

import com.heima.model.wemedia.pojos.WmUser;


/**
 * @author itheima
 * @since 2022-07-10
 */
public class WmUserThreadLocal {

    // 1. 声明一个ThreadLocal类型的变量
    private static ThreadLocal<WmUser> userThreadLocal = new ThreadLocal<>();

    // 2. 为这个变量配置一对 get set方法
    public static WmUser get() {
        return userThreadLocal.get();
    }

    public static void set(WmUser wmUser) {
        userThreadLocal.set(wmUser);
    }

    // 3. 为这个变量配置一个 remove 方法
    public static void remove() {
        userThreadLocal.remove();
    }

}